#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int isSelfDivide(int i)
{
    int tmp = i;
    while (tmp > 0)
    {
        int num = tmp % 10;
        if (num == 0 || i / num != 0)
            return 0;
        else
            tmp /= 10;
    }
    return 1;
}

int* selfDividingNumbers(int left, int right, int* returnSize) {
    int* arr = (int*)malloc(4 * (right - left));
    int i = 0;
    int m = 0;
    int ret = 0;
    for (i = left; i <= right; i++)
    {
        ret = isSelfDivide(i);
        if (ret == 1)
        {
            arr[m++] = i;
        }
    }
    *returnSize = m;
    return arr;
}

int main()
{
	int left = 0;
	int right = 0;
    int returnSize = 0;
	scanf("%d %d", &left, &right);
    int* arr1 = selfDividingNumbers(left, right, &returnSize);
    int i = 0;
    for (i = 0; i < returnSize; i++)
    {
        printf("%d ", arr1[i]);
    }
}